package itheima.com.Test;

public class MyVariableParmeter01 {
    public static void main(String[] args) {
        int[] arr ={1,2,3,4,5};

        int sum = getSum(arr);
        System.out.println(sum);
    }

    private static int getSum(int[] arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        return sum;
    }
}
